package com.team.mp.api.controller;

import com.team.mp.mapper.entity.ServiceinfoFinished;
import com.team.mp.api.service.intf.ServiceinfoFinishedService;
import com.team.mp.vo.R;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import javax.annotation.Resource;

import io.swagger.models.auth.In;
import org.springframework.web.bind.annotation.*;

/**
 * 千锋郑州Java学科欢迎你
 * @program: MyProject
 * @description: 控制层实现常用的外部接口
 * @author: Xuerui
 * @create: 2023-03-27 19:55:06
 */
@RestController
@RequestMapping("/api/serviceinfoFinished/")
@Api(tags = "实现服务完成记录接口")
public class ServiceinfoFinishedController{
    /**
    * 注入业务逻辑层对象*/
    @Resource
    private ServiceinfoFinishedService service;
    /**
    * 新增内容*/
    @ApiOperation(value = "实现新增")
    @PostMapping("save.do")
    public R save(@RequestBody ServiceinfoFinished serviceinfoFinished){
       return service.save(serviceinfoFinished);
    }
    /**
    * 修改内容*/
    @ApiOperation(value = "实现修改")
    @PostMapping("update.do")
    public R update(@RequestBody ServiceinfoFinished serviceinfoFinished){
        return service.update(serviceinfoFinished);
    }
    /**
    * 查询 所有数据*/
    @ApiOperation(value = "实现全部查询")
    @GetMapping("all.do")
    public R all(){
       return service.queryAll();
    }
//    /**
//    * 查询 单个数据 ById*/
//    @ApiOperation(value = "实现查询单个")
//    @GetMapping("single.do")
//    public R single(long id){
//        return service.queryById(id);
//    }

    /**
     * 查询 单个数据 By服务信息Id*/
    @ApiOperation(value = "实现查询单个")
    @GetMapping("single1.do")
    public R singleBySid(Integer sid){
        return service.queryBySid(sid);
    }
    /**
    * 删除 单个数据*/
    @ApiOperation(value = "实现删除")
    @DeleteMapping("del.do")
    public R del(long id){
        return service.del(id);
    }
}
